﻿<Window x:Class="DrawingIn3D.OneTriangleMesh"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="OneTriangleMesh" Height="300" Width="300"
        xmlns:tools="clr-namespace:_3DTools;assembly=3DTools"
    >
    <Grid Margin="5">
      <Border BorderBrush="Yellow" BorderThickness="1">
      <Viewport3D>
        <Viewport3D.Camera>
          <PerspectiveCamera
          Position="-2,2,2"
          LookDirection="2,-2,-2"
          UpDirection="0,1,0"
           />
        </Viewport3D.Camera>
        <ModelVisual3D>
          <ModelVisual3D.Content>            
            <DirectionalLight
             Color="White"
             Direction="-1,-1,-1" />
          </ModelVisual3D.Content>          
        </ModelVisual3D>

        <ModelVisual3D>
          <ModelVisual3D.Content>
            <GeometryModel3D>
              <GeometryModel3D.Geometry>
                <MeshGeometry3D Positions="-1,0,0 0,1,0 1,0,0"
                                TriangleIndices="0,2,1" />
              </GeometryModel3D.Geometry>

              <GeometryModel3D.Material>
                <DiffuseMaterial Brush="Yellow" />
              </GeometryModel3D.Material>

            <!--  <GeometryModel3D.BackMaterial>
                <DiffuseMaterial Brush="Green" />
              </GeometryModel3D.BackMaterial>-->

            </GeometryModel3D>
          </ModelVisual3D.Content>
        </ModelVisual3D>

        <tools:ScreenSpaceLines3D Points="0,-10,0 0,10,0"
          Thickness="1" Color="Blue">
        </tools:ScreenSpaceLines3D>
        <tools:ScreenSpaceLines3D Points="-10,0,0 10,0,0"
          Thickness="1" Color="Red">
        </tools:ScreenSpaceLines3D>
        <tools:ScreenSpaceLines3D Points="0,0,-10 0,0,10"
          Thickness="1" Color="Green">
        </tools:ScreenSpaceLines3D> 
      </Viewport3D>
      </Border>
    </Grid>
</Window>
